/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						       random_monster_experience.h

	$Header: /game/random_monster_experience.h $

	$NoKeywords: $

 ************************************************************************/

#include "precompiled.h"
#include "random_monster_experience.h"

#include "random.h"

double get_monster_difficulty( t_difficulty difficulty )
{
	static double const k_ratio[] = { 0.6667, 1.0, 1.5, 2.0, 3.0 };

	return k_ratio[difficulty];
}

// -------------------------------------------------------------------
// -------------------------------------------------------------------
void get_random_monster_experience_range( int level, int & min, int & max )
{
	assert( level >= 1 && level <= 4 );
	static int const	k_one_week[4] = { 155, 310, 620, 1240 };
	static double const	k_weeks[4] = { 2.0, 2.5, 3.0, 4.0 };
	double				base;

	base = k_one_week[level-1] * k_weeks[level-1];

	min = int(base * 0.8);
	max = int(base * 1.2);
}

// -------------------------------------------------------------------
// -------------------------------------------------------------------
int get_random_monster_experience( int level )
{
	int min;
	int max;
	get_random_monster_experience_range( level, min, max );
	return random( min, max );
}
